How to find the length of a singly LinkedList in Java